<template>
  <div class="more-tools">
    <el-button @click="link2manager">更多功能请登陆管理端</el-button>
  </div>
</template>

<script>
export default {
  name: 'MoreTools',
  data() {
    return {
    }
  },
  methods: {
    // 跳转到管理端
    link2manager() {
      let url = 'http://47.108.193.26/index'
      // 如果是桌面应用
      if (this.currentMode === 'electron') {
        const { shell } = window.require('electron')
        shell.openExternal(url)
      } else {
        var a = document.createElement('a');
        a.setAttribute('href', url);
        a.setAttribute('target', '_blank');
        a.setAttribute('id', 'js_a');
        //防止反复添加
        if (document.getElementById('js_a')) {
          document.body.removeChild(document.getElementById('js_a'));
        }
        document.body.appendChild(a);
        a.click();
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.more-tools {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
}
</style>
